<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main {
            width: 600px;
            height: 40px;
            display: flex;
            margin: 0 auto;
            text-align: center;
            list-style: none;
        }

        .main li {
            flex: 1;
            border: 1px solid black;
            line-height: 40px;
        }

        .main li+li {
            border-left: 0;
        }
    </style>
</head>

<body>
    <ul class="main">
        <li>01</li>
        <li>02</li>
        <li>03</li>
        <li>04</li>
        <li>05</li>
        <li>06</li>
    </ul>
</body>
<script>
    var liList = Array.from(document.querySelectorAll('.main li'))
    liList.forEach(function (li, index) {
        li.onclick = function () {
            console.log(this, index)
        }
    })


    

</script>

</html>